<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <c></c>
  <c>
    <template slot-scope="slot">
<!--      <span v-for="item in slot.data">{{item}}——</span>-->
<!--      join()这个函数的方法就是说可以让两个参数根据提供的参数进行拼接！-->
      <span>{{slot.data.join(' - ')}}</span>
    </template>
  </c>
</div>

<template id="cpn">
  <div>
<!--    作用域的使用-->
    <slot :data="arr">
      <ul>
        <li v-for="item in arr">{{item}}</li>
      </ul>
    </slot>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  //let(变量)和const(常量)
  const app = new Vue({
    el: '#app',
    data: {
      message: '中国牛蛙！'
    },
    components: {
      c: {
        template: `#cpn`,
        data() {
          return {
            arr: ['a','b','c','d','e','f']
          }
        },
      }
    }
  })
</script>
</body>
</html>